<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.6"/>
<title>libnetconf: NETCONF over TLS</title>
<link href="../../tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../jquery.js"></script>
<script type="text/javascript" src="../../dynsections.js"></script>
<link href="../../navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../resize.js"></script>
<script type="text/javascript" src="../../navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
  $(window).load(resizeHeight);
</script>
<link href="../../search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="../../search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="../../doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="../../libnetconf-logo.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">libnetconf
   &#160;<span id="projectnumber">0.10.0-146_trunk</span>
   </div>
   <div id="projectbrief">NETCONF Library</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.6 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "../../search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="../../index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="../../pages.html"><span>Related&#160;Pages</span></a></li>
      <li><a href="../../modules.html"><span>Modules</span></a></li>
      <li><a href="../../annotated.html"><span>Data&#160;Structures</span></a></li>
      <li><a href="../../files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="../../search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="../../search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('db/db4/group__tls.html','../../');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Macros</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(10)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#func-members">Functions</a>  </div>
  <div class="headertitle">
<div class="title">NETCONF over TLS</div>  </div>
</div><!--header-->
<div class="contents">

<p>libnetconf's functions to use TLS. More information can be found at <a class="el" href="../../d4/d76/transport.html">Transport Protocol</a> page.  
<a href="#details">More...</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:gacf3aed5cccac55d0548f46761707ece9"><td class="memItemLeft" align="right" valign="top">void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/db4/group__tls.html#gacf3aed5cccac55d0548f46761707ece9">nc_tls_destroy</a> (void)</td></tr>
<tr class="memdesc:gacf3aed5cccac55d0548f46761707ece9"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destroy all resources allocated for preparation of TLS connections.  <a href="#gacf3aed5cccac55d0548f46761707ece9">More...</a><br/></td></tr>
<tr class="separator:gacf3aed5cccac55d0548f46761707ece9"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:gacbf946a826fa6c7c18a4e66d532b659f"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="../../db/db4/group__tls.html#gacbf946a826fa6c7c18a4e66d532b659f">nc_tls_init</a> (const char *peer_cert, const char *peer_key, const char *CAfile, const char *CApath, const char *CRLfile, const char *CRLpath)</td></tr>
<tr class="memdesc:gacbf946a826fa6c7c18a4e66d532b659f"><td class="mdescLeft">&#160;</td><td class="mdescRight">Set paths to the client certificate and its private key.  <a href="#gacbf946a826fa6c7c18a4e66d532b659f">More...</a><br/></td></tr>
<tr class="separator:gacbf946a826fa6c7c18a4e66d532b659f"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<p>libnetconf's functions to use TLS. More information can be found at <a class="el" href="../../d4/d76/transport.html">Transport Protocol</a> page. </p>
<p>These functions are experimental. It is possible, that TLS transport (and mainly certificates management) is not fully implemented in this version.</p>
<p>Remember, that to make these functions available, libnetconf must be compiled with &ndash;enable-tls configure's option. </p>
<h2 class="groupheader">Function Documentation</h2>
<a class="anchor" id="gacf3aed5cccac55d0548f46761707ece9"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">void nc_tls_destroy </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Destroy all resources allocated for preparation of TLS connections. </p>
<p>See <a class="el" href="../../db/db4/group__tls.html#gacbf946a826fa6c7c18a4e66d532b659f" title="Set paths to the client certificate and its private key. ">nc_tls_init()</a> for more information about NETCONF session preparation.</p>
<p>To make this function available, you have to include <a class="el" href="../../d5/d22/libnetconf__tls_8h.html" title="libnetconf&#39;s header for control openssl. ">libnetconf_tls.h</a> header file. </p>

</div>
</div>
<a class="anchor" id="gacbf946a826fa6c7c18a4e66d532b659f"></a>
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">int nc_tls_init </td>
          <td>(</td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>peer_cert</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>peer_key</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>CAfile</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>CApath</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>CRLfile</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const char *&#160;</td>
          <td class="paramname"><em>CRLpath</em>&#160;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td>
        </tr>
      </table>
</div><div class="memdoc">

<p>Set paths to the client certificate and its private key. </p>
<p>This function takes effect only on client side. It must be used before establishing NETCONF session (including call home) over TLS.</p>
<p>This function is thread-safe. It is supposed to be part of the process of establishing NETCONF session within a single thread:</p>
<ol type="1">
<li>Use <a class="el" href="../../db/db4/group__tls.html#gacbf946a826fa6c7c18a4e66d532b659f" title="Set paths to the client certificate and its private key. ">nc_tls_init()</a> to set client certificate and CA for server certificate verification. Calling this function repeatedly with different parameters changes those parameter for new NETCONF session created after the call. Any currently used NETCONF session will be still using the settings specified before the creation of the NETCONF session.</li>
<li>Establish NETCONF session using <a class="el" href="../../db/d52/group__session.html#gae3858d998d19cb2fb700b15fdf602f23" title="Create NETCONF session to the specified server. ">nc_session_connect()</a>. If you don't need to change parameters set in <a class="el" href="../../db/db4/group__tls.html#gacbf946a826fa6c7c18a4e66d532b659f" title="Set paths to the client certificate and its private key. ">nc_tls_init()</a>, you can call <a class="el" href="../../db/d52/group__session.html#gae3858d998d19cb2fb700b15fdf602f23" title="Create NETCONF session to the specified server. ">nc_session_connect()</a> repeatedly.</li>
<li>To properly clean all resources, call <a class="el" href="../../db/db4/group__tls.html#gacf3aed5cccac55d0548f46761707ece9" title="Destroy all resources allocated for preparation of TLS connections. ">nc_tls_destroy()</a>. It will destroy TLS connection context in the current thread.</li>
</ol>
<dl class="params"><dt>Parameters</dt><dd>
  <table class="params">
    <tr><td class="paramdir">[in]</td><td class="paramname">peer_cert</td><td>Path to the file containing client certificate </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">peer_key</td><td>Path to the file containing private key for the client certificate. If NULL, key is expected to be stored in the file specified in cert parameter. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">CAfile</td><td>Location of the CA certificate used to verify the server certificates. For More info, see documentation for SSL_CTX_load_verify_locations() function from OpenSSL. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">CApath</td><td>Location of the CA certificates used to verify the server certificates. For More info, see documentation for SSL_CTX_load_verify_locations() function from OpenSSL. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">CRLfile</td><td>Location of the CRL certificate used to check for revocated certificates. </td></tr>
    <tr><td class="paramdir">[in]</td><td class="paramname">CRLpath</td><td>Locarion of the CRL certificates used to check for revocated certificates. </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>EXIT_SUCCESS or EXIT_FAILURE </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="footer">Generated on Fri Apr 15 2016 09:20:09 for libnetconf by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="../../doxygen.png" alt="doxygen"/></a> 1.8.6 </li>
  </ul>
</div>
</body>
</html>
